import 'package:flutter/material.dart';
import 'package:flutter_module/app.dart';
import 'package:flutter_module/config/storage_manager.dart';
import 'package:flutter_module/pages/root/root_page.dart';

/*
* App入口
* */
void main() async {
  print("project start");
  /// 确保初始化
  WidgetsFlutterBinding.ensureInitialized();
  /// 配置初始化
  await StorageManager.init();
  /// Android状态栏透明
  // if (Platform.isAndroid) {
  //   SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(
  //     statusBarColor: Colors.transparent,
  //     statusBarBrightness: Brightness.light,
  //   );
  //   SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  // }
  /// App入口
  runApp(new MyApp());
  /// 自定义报错页面
  ErrorWidget.builder = (FlutterErrorDetails flutterErrorDetails) {
    debugPrint(flutterErrorDetails.toString());
    return new RootPage();
  };
}
